package com.ff.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ff.dao.WaresDao;
import com.ff.model.Wares;

@Service
public class WaresService {
	@Autowired
	private WaresDao wdao;
	public void setWdao(WaresDao wdao) {
		this.wdao = wdao;
	}
	
	public int find_() {
		List<Wares> list=wdao.select_();
		int a=15;
		int b=list.size();
		int c=(b/a)+1;
		return c;
	}
	public List<Wares> find_limit(int id) {
		int id1=1;
		int cnt1=15;
		if(id!=0) {
			id1=id;
		}
		int id2=(id1-1)*cnt1;
		return wdao.select_limit(id2, cnt1);
	}
	public int insert11(Wares f) {
		return wdao.insert11(f);
	}
	public Wares find11(int id) {
		return wdao.find11(id);
	}
	public int update11(Wares f) {
		return wdao.update11(f);
	}
	public int delete01(int id) {
		return wdao.delete01(id);
	}

	public List<Wares> findffname(String username) {
		return wdao.findffname(username);
	}
	public List<Wares> select_(){
		return wdao.select_();
	}
}
